﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IQKS.AWP.DataAccessLayer;
using IQKS.AWP.BusinessObject;
using IQKS.AWP.BusinessAccessLayer;
using System.Globalization;
using System.Configuration;
public partial class Admin_AssessorInvoiceDetail : System.Web.UI.Page
{
    Guid gudUserID = CommonUtility.GetLoggedOnUserId();

    private DataSet GetDataSet()
    {
        DataSet objDs = null;
        try
        {
            //objDs = new AssessorInvoiceBAL().GetAssessorInvoice();
            objDs = new AssessorInvoiceBAL().GetInvoiceByAssessorID(CommonUtility.GetLoggedOnUserId());


        }
        catch (Exception exception)
        {
            exception.AddErrorToLog(); //throw new ApplicationException(exception.Message);
        }
        return objDs;


    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GetData();

        }
    }

    public string GetInvoiceReceiptUrl(object invoiceID)
    {
        string strPath = string.Empty;

        strPath = "~/assessor/assesorbill.aspx?invoiceid=" + invoiceID;

        return strPath;
    }
    public string GetInvoiceReceipt(object invoiceID)
    {
        string strPath = string.Empty;

        strPath = "~/assessor/UploadInvoice.aspx?invoiceid=" + invoiceID;

        return strPath;
    }
    private void GetData()
    {

        gvAInvoice.DataSource = GetDataSet();
        gvAInvoice.DataBind();
    }

    protected void btnUploadInvoice_Click(object sender, EventArgs e)
    {
        Response.Redirect("AssessorInvoice.aspx");
    }
    public void gvAInvoice_RowDataBound(object sender, GridViewRowEventArgs e)
    {

        if (e.Row.RowType == DataControlRowType.DataRow)
        {

            Label lblUpload = (Label)e.Row.FindControl("lblUpload");

            HyperLink lnkUpload = (HyperLink)e.Row.FindControl("lnkUpload");
            if (lblUpload.Text == "True")
            {
                lnkUpload.Visible = false;

            }
            else
            {
                lnkUpload.Visible = true;
            }

        }

    }






}